#! /bin/bash

# real-time upload script for MXCO data
station="mxco"
OPTIONS=""
#OPTIONS="-m1440 --timeout=45"
SLEEP=0
export PYTHONPATH=$HOME/src/python/site-packages

BIN=$PYTHONPATH/nmdb/bin
SUFFIX=`date +%Y%m%d`
STATION="$(echo $station | tr '[:lower:]' '[:upper:]')"
LOG=$HOME/logs/NMDB_$STATION.log.$SUFFIX

# wait for the data to be available
sleep $SLEEP
date --utc >>$LOG
$BIN/upload.py $station ori $OPTIONS 2>&1 >>$LOG
echo >>$LOG
$BIN/upload.py $station 1h $OPTIONS 2>&1 >>$LOG
echo >>$LOG

echo >>$LOG
